package net.mikoo.seals.biz.manager;

import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Component;

import net.mikoo.seals.common.exception.ParametersException;
import net.mikoo.seals.model.DevicesUsed;

@Component
public class DevicesUsedManager {

	public void checkParams(DevicesUsed used) {

		if (used == null) {
			throw new ParametersException("非法参数");
		}

		if (used.getDevicesId() == null && used.getSealId()== null) {
			throw new ParametersException("DevicesId is null");
		}

		if (used.getDevicesActId() == null) {
			throw new ParametersException("DevicesActId is null");
		}
		if (used.getPartyId() == null) {
			throw new ParametersException("PartyId is null");
		}

		if (used.getCompanyId() == null) {
			throw new ParametersException("CompanyId is null");
		}

		if (StringUtils.isBlank(used.getUsedIp())) {
			throw new ParametersException("使用人所在Ip地址不能为空");
		}

	}

}
